import com.ruoyi.MainApplication;
import com.ruoyi.project.tool.gen.service.IGenTableColumnService;
import com.ruoyi.project.tool.gen.service.IGenTableService;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;


@RunWith(SpringRunner.class)
@SpringBootTest(classes = MainApplication.class)
public class GenTable_Dreprecated {
    @Autowired
    private IGenTableService genTableService;

    @Autowired
    private IGenTableColumnService genTableColumnService;

    String[] tableNames = {
//            "schedule_clock_punch"
//            "schedule_daily_schedule"
//            "schedule_month_schedule"
//            "schedule_config_sche_define"
//            "schedule_salary_detail"
//            "schedule_month_salary"
    };

//    @Test
//    public void genCode() {
//        // 先查库里面的表定义元数据
//        List<GenTable> tableList = genTableService.selectDbTableListByNames(tableNames);
//        if(CollectionUtils.isNotEmpty(tableList)) {
//            for (GenTable genTable : tableList) {
//                // 单表
//                GenTable dbExisted = genTableService.selectGenTableWithColumns(genTable.getTableName());
//                if(dbExisted != null) {
//                    genTableService.generatorCodeToDisk(dbExisted);
//                } else {
//                    genTableService.importGenTableLocal(genTable);
//                    genTableService.generatorCodeToDisk(genTable);
//                }
//
//            }
//        }
//
//
//    }


}